package co.com.inventarios.modelo;

import java.sql.Timestamp;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Mngmcnsn entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "MNGMCNSN", schema = "MANAGER", uniqueConstraints = {})
public class Mngmcnsn implements java.io.Serializable {

	// Fields

	private MngmcnsnId id;
	private Mngmcn mngmcn;
	private Long msnestado;
	private Double msnvalor1;
	private Timestamp msnlogfec;
	private Dlluser dlluser;
	// Constructors

	/** default constructor */
	public Mngmcnsn() {
	}

	/** minimal constructor */
	public Mngmcnsn(MngmcnsnId id, Mngmcn mngmcn) {
		this.id = id;
		this.mngmcn = mngmcn;
	}

	/** full constructor */
	public Mngmcnsn(MngmcnsnId id, Mngmcn mngmcn, Long msnestado,
			Dlluser dlluser,Timestamp msnlogfec,
			Double msnvalor1) {
		this.id = id;
		this.mngmcn = mngmcn;
		this.msnestado = msnestado;
		this.msnlogfec = msnlogfec;
		this.dlluser = dlluser;
		this.msnvalor1 = msnvalor1;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "msnempresa", column = @Column(name = "MSNEMPRESA", unique = false, nullable = false, insertable = true, updatable = true, length = 3)),
			@AttributeOverride(name = "msnclase", column = @Column(name = "MSNCLASE", unique = false, nullable = false, insertable = true, updatable = true, length = 4)),
			@AttributeOverride(name = "msnvinkey", column = @Column(name = "MSNVINKEY", unique = false, nullable = false, insertable = true, updatable = true, length = 15)),
			@AttributeOverride(name = "msntipodoc", column = @Column(name = "MSNTIPODOC", unique = false, nullable = false, insertable = true, updatable = true, length = 4)),
			@AttributeOverride(name = "msnnumedoc", column = @Column(name = "MSNNUMEDOC", unique = false, nullable = false, insertable = true, updatable = true, precision = 13, scale = 1)),
			@AttributeOverride(name = "msnreg", column = @Column(name = "MSNREG", unique = false, nullable = false, insertable = true, updatable = true, precision = 8, scale = 1)),
			@AttributeOverride(name = "msnserial", column = @Column(name = "MSNSERIAL", unique = false, nullable = false, insertable = true, updatable = true, length = 50)) })
	public MngmcnsnId getId() {
		return this.id;
	}

	public void setId(MngmcnsnId id) {
		this.id = id;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "MSNEMPRESA", referencedColumnName = "MCNEMPRESA", unique = false, nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "MSNCLASE", referencedColumnName = "MCNCLASE", unique = false, nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "MSNVINKEY", referencedColumnName = "MCNVINKEY", unique = false, nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "MSNTIPODOC", referencedColumnName = "MCNTIPODOC", unique = false, nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "MSNNUMEDOC", referencedColumnName = "MCNNUMEDOC", unique = false, nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "MSNREG", referencedColumnName = "MCNREG", unique = false, nullable = false, insertable = false, updatable = false) })
	public Mngmcn getMngmcn() {
		return this.mngmcn;
	}

	public void setMngmcn(Mngmcn mngmcn) {
		this.mngmcn = mngmcn;
	}

	@Column(name = "MSNESTADO", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getMsnestado() {
		return this.msnestado;
	}

	public void setMsnestado(Long msnestado) {
		this.msnestado = msnestado;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "MSNLOGUSER", unique = false, nullable = true, insertable = true, updatable = true)
	public Dlluser getDlluser() {
		return this.dlluser;
	}

	public void setDlluser(Dlluser dlluser) {
		this.dlluser = dlluser;
	}

	@Column(name = "MSNLOGFEC", unique = false, nullable = true, insertable = true, updatable = true)
	public Timestamp getMsnlogfec() {
		return this.msnlogfec;
	}

	public void setMsnlogfec(Timestamp msnlogfec) {
		this.msnlogfec = msnlogfec;
	}
	
	@Column(name = "MSNVALOR1", unique = false, nullable = true, insertable = true, updatable = true, precision = 12)
	public Double getMsnvalor1() {
		return this.msnvalor1;
	}

	public void setMsnvalor1(Double msnvalor1) {
		this.msnvalor1 = msnvalor1;
	}

}